package com.wy2.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wy2.entity.Follow;
import com.wy2.mapper.FollowMapper;
import com.wy2.service.FollowService;
import com.wy2.util.FenyeUtil;

@Service
public class FollowServiceimpl implements FollowService {
	
	@Autowired
	private FollowMapper fm;
	/**
	 * 分页查询
	 */
	@Override
	public FenyeUtil<Follow> getAll(FenyeUtil<Follow> fenye) {
		Integer count = fm.getCount(fenye);
		List<Follow> data = fm.getData(fenye);
		if(data.size()>0) {
			fenye.setCount(count);
			fenye.setData(data);
		}else {
			fenye.setCode(1);
			fenye.setMsg("无数据");
		}
		return fenye;
	}
/**
 * 添加
 */
	@Override
	public Integer addFol(Follow f) {
		// TODO Auto-generated method stub
		return fm.addFol(f);
	}
    /**
     * 修改
     */
	@Override
	public Integer updFol(Follow f) {
		// TODO Auto-generated method stub
		return fm.updFol(f);
	}
     /**
      * 删除
      */
	@Override
	public Integer delFol(Integer fid) {
		// TODO Auto-generated method stub
		return fm.delFol(fid);
	}

}
